using System;
using System.Collections.Generic;
using System.Text;

namespace BetaIto.ChaosDAV
{
    public class CfsException : Exception
    {
        protected string _detail;
        protected GfsError _code;
        protected object[] _paramList;

        public GfsError ErrorCode
        {
            get { return _code; }
            set { _code = value; }
        }
	
        //public string DetailMessage
        //{
        //    get { return _detail; }
        //    set { _detail = value; }
        //}
	
        public CfsException(string message) : base(message)
        {
        }

        public CfsException(string message, Exception excep) : base(message, excep)
        {
            
        }

        public CfsException(GfsError code)
            : base(CfsErrorMessage.GetMessage(code, null))
        {
            _code = code;
        }

        public CfsException(GfsError code, Exception excep)
            : base(CfsErrorMessage.GetMessage(code, null), excep)
        {
            _code = code;
        }

        public CfsException(GfsError code, object[] paramList)
            : base(CfsErrorMessage.GetMessage(code, paramList))
        {
            _code = code;
            _paramList = paramList;
//            string message = GfsErrorMessage.GetMessage(code);
//            message = string.Format(message, paramList);
        }

        public CfsException(GfsError code, object[] paramList, Exception excep)
            : base(CfsErrorMessage.GetMessage(code, paramList), excep)
        {
            _code = code;
            _paramList = paramList;
//            string message = GfsErrorMessage.GetMessage(code);
//            message = string.Format(message, paramList);
//            this.DetailMessage = message;
        }


    }
}
